package com.webside.Advertisingstatistics.mapper;

import java.util.Date;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.webside.Advertisingstatistics.model.AdDailyStatEntity;
import com.webside.base.basemapper.BaseMapper;
import com.webside.resource.model.ResourceEntity;

/***
 * lpz 统计每天的数据
 * 
 * @author Administrator
 *
 */
@Repository
public interface AdDailyStatMapper extends BaseMapper<ResourceEntity, Long> {

	// 在每日00:01分的时候将昨日的数据统计出来并存入mysql中
	public int addadDailyStat(AdDailyStatEntity adDailyStat);
	//查询昨日的数据
	public AdDailyStatEntity selectYesterDayAll(@Param("yesterDay") String yesterDay);
	
	//查询近90日平均的广告总曝光量，总点击量，总独立访客总Ip数
	public AdDailyStatEntity avgAdDailyStatCount(@Param("newTime") String newTime,@Param("oldTime") String oldTime);
	
	//查询近90日平均的广告总曝光量，总点击量，总独立访客总Ip数(数据不满90条就拿到总数然后/90)
	public AdDailyStatEntity sumAvgAdDailyStatCount(@Param("newTime") String newTime,@Param("oldTime") String oldTime);
		
	
	//查询历史广告总曝光量，总点击量，总独立访客总Ip数的峰值
	public AdDailyStatEntity maxAdDailyStatCount();
	
	//查询历史广告总曝光量，总点击量，总独立访客总Ip数的累计
	public AdDailyStatEntity sumAdDailyStatCount();
}
